parser grammar GraphParser;

options {
  language = Java;
  tokenVocab = GraphLexer;
}

@header {
    package es.etsii.pl.P6_Flexer;
}

gdldocument : graph ;

graph: GRAPH COLON CURLYOPEN (node | edge)* CURLYCLOSE ;
node: NODE COLON CURLYOPEN (node_attr)+ CURLYCLOSE ;
node_attr: (title | label | borderstyle)+ ;
title: TITLE COLON STRING ;
label: LABEL COLON  STRING ;
borderstyle: BORDERSTYLE COLON BORDERSTYLE_ATTR ;

edge: EDGE COLON CURLYOPEN (edge_attr)+ CURLYCLOSE ;
edge_attr: (source | target | arrowstyle)+ ;
source: SOURCE COLON STRING ;
target: TARGET COLON STRING ;
arrowstyle: ARROWSTYLE COLON ARROWSTYLE_ATTR ;
